package com.example.controller.datastatistics.yanglaofuwusheshi;

import com.example.bean.datastatistics.yanglaofuwusheshi.YangLaoFuWuSheShiDuoTiaoJian;
import com.example.service.datastatistics.yanglaofuwusheshi.YangLaoFuSheShiService;
import com.example.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/sheshi")
public class YangLaoFuSheShiController {
    @Autowired
    YangLaoFuSheShiService yangLaoFuSheShiService;
    @PostMapping
    public Result result(@RequestBody YangLaoFuWuSheShiDuoTiaoJian yangLaoFuWuSheShiDuoTiaoJian){
        Result result = new Result();
//        if (yangLaoFuSheShiService.yanglaofuwusheshiList(yangLaoFuWuSheShiDuoTiaoJian).isEmpty()){
            result.ok();
            result.setData(yangLaoFuSheShiService.yanglaofuwusheshiList(yangLaoFuWuSheShiDuoTiaoJian));
//        }
//        result.setMessage("有误");
        return result;
    }
}
